

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layDate 日期组件功能演示一</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="./layuiadmin/layui/css/layui.css" media="all">

      
      <!-- <div class="layui-col-md12"> -->
        <!-- <div class="layui-card"> -->
       
                <div class="layui-inline">
                  <label class="layui-form-label">日期范围</label>
                  <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test-laydate-range-date" placeholder=" - ">
                  </div>
                </div>

        <!-- </div> -->
      <!-- </div> -->
      
     
  
  <script src="./layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: './layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'laydate'], function(){
    var laydate = layui.laydate;
//     var nowdate= new Date();  
//     console.log("now:"+(nowdate.getMonth()+1))
//     M=nowdate.getMonth()
// date = nowdate.getDate()
// day = nowdate.getDay()
// console.log("date:"+date)
// console.log("day:"+day)
//     h = nowdate.getHours()
//     y=nowdate.getFullYear()
//     console.log("y:"+y)
   
    //日期范围
    var stime=   laydate.render({
      elem: '#test-laydate-range-date'
      ,range: true,
      
      min:0,//最大值为当前日期
    //   value: new Date(), //参数即为：2018-08-20 20:08:08 的时间戳 (当天日期)
//    done:function(value,dates){
//     	console.log(value); //得到日期生成的值，如：2017-08-18
// 	    console.log(dates); //得到日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}    	   
// 	    // console.log(d);
// 	    stime.config.min={
//     			year:y,
//     			month:M,
//     			date:date,
//     	};

//     }
    });
    
    
  });
  </script>
</body>
</html>